<template>
  <div class="login-container">
    <div class="login-left"></div>
    <div class="login-form">
      <div class="logo">
        <img src="@/assets/logo1.png" alt="Nextacks Logo" class="logo-img" />
      </div>
      <h1 class="title">欢迎使用云HIS系统</h1>
      <p class="subtitle">方便 | 快捷 | 高效</p>

      <form @submit.prevent="handleSubmit">
        <div class="form-group">
          <label for="email">系统账号</label>
          <input
            type="email"
            id="email"
            v-model="email"
            placeholder="请输入系统账号"
            required
          />
        </div>

        <div class="form-group">
          <label for="password">系统密码</label>
          <div class="password-input">
            <input
              :type="showPassword ? 'text' : 'password'"
              id="password"
              v-model="password"
              placeholder="请输入系统密码"
              required
            />
            <button
              type="button"
              class="password-toggle"
              @click="showPassword = !showPassword"
            >
              <i :class="showPassword ? 'fas fa-eye-slash' : 'fas fa-eye'"></i>
            </button>
          </div>
        </div>
        <button type="submit" class="sign-in-btn">登录系统</button>
 
      </form>
      <div class="footer">
          <span>Copyright © 2006-2025 <a href="#">黑龙江若康科技有限公司</a></span>
        </div>
    </div>
  </div>
</template>

<script setup>
import { ref } from "vue";

const email = ref("");
const password = ref("");
const rememberMe = ref(false);
const showPassword = ref(false);

const handleSubmit = () => {
  // Handle form submission
  console.log({
    email: email.value,
    password: password.value,
    rememberMe: rememberMe.value,
  });
};
</script>

<style scoped lang="less">
.footer {
  box-sizing: border-box;
  z-index: 111;
  text-align: center;
  height: 40px;
  // line-height: 40px;
  bottom: 0;
left: 0px;
  width: 100%;
  position: absolute;

  span {
    font-size: 14px;
    color: #333;
    a {
      color: #8c87e9;
      text-decoration: none;
    }
  }
}
.login-container {
  display: flex;
  min-height: 100vh;
  background-color: #f8f9fe;
}

.login-left {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background-image: url("../assets/bg4.jpg");
  background-size: cover;
  background-position: center;
}

.illustration {
  max-width: 100%;
  height: auto;
  background-image: url("../assets/bg3.png");
}

.login-form {
  padding-top: 200px !important;
  flex: 1;
  max-width: 720px;
  padding: 3rem;
  background-color: white;
  display: flex;
  flex-direction: column;
  position: relative;
}

.logo {
  // margin-bottom: 1rem;
  padding-top: 20px;
  position: absolute;
  top: 0px;
  // left: 0px;
}

.logo-img {
  height: 80px;
}

.title {
  font-size: 2rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 0.5rem;
}

.subtitle {
  color: #666;
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  color: #333;
  font-weight: 500;
}

input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  font-size: 0.8rem;
  transition: border-color 0.2s;
}

input:focus {
  outline: none;
  border-color: #6366f1;
}

.password-input {
  position: relative;
}

.password-toggle {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
}

.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.remember-me {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.forgot-password {
  color: #6366f1;
  text-decoration: none;
}

.sign-in-btn {
  width: 100%;
  padding: 0.75rem;
  background-color: #6366f1;
  color: white;
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
}

.sign-in-btn:hover {
  background-color: #4f46e5;
}

.social-login {
  margin-top: 2rem;
  text-align: center;
}

.social-login p {
  color: #666;
  margin-bottom: 1rem;
}

.social-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.social-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid #e2e8f0;
  background: white;
  color: #666;
  cursor: pointer;
  transition: all 0.2s;
}

.social-btn:hover {
  background-color: #f8f9fe;
}

.signup-link {
  margin-top: 2rem;
  text-align: center;
  color: #666;
}

.signup-link a {
  color: #6366f1;
  text-decoration: none;
  font-weight: 500;
}

@media (max-width: 768px) {
  .login-container {
    flex-direction: column;
  }

  .login-left {
    display: none;
  }

  .login-form {
    max-width: 100%;
  }
}
</style>
